package com.itany.shop.service;

import com.itany.shop.entity.Order;
import com.itany.shop.entity.User;
import com.itany.shop.exception.RequestParameterErrorException;
import com.itany.shop.exception.UserNotLoginException;
import com.itany.shop.vo.Cart;

import java.util.List;

/**
 * @author Miss Chen
 * @version 1.0
 * @date 2024年08月16日14:43
 */
public interface OrderService {

    /**
     * 结算，用于生成订单
     * 生成订单时候生成一个订单与多个明细
     * 订单号自动生成
     * @param cart
     * @param user
     * @return
     */
    String createOrder(Cart cart, User user) throws UserNotLoginException;

    /**
     * 查询我的订单
     * @param user
     * @return
     */
    List<Order> findMyOrders(User user) throws UserNotLoginException;

    /**
     * 根据订单id查询订单详情
     * @param id
     * @return
     */
    Order findOrderDetail(Integer id) throws RequestParameterErrorException;
}
